From: Matthieu Gallien Date: Fri, 4 Apr 2025 14:37:11 +0000 (+0200) Subject: when deleting a folder starts by making it read-write permissions X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2^2~48^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b97f7eb84cb76f435f2b66d20a8c6a9fbae1f7d4;p=nextcloud-desktop.git when deleting a folder starts by making it read-write permissions Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/filesystem.cpp b/src/libsync/filesystem.cpp index ecf950fe3..5b719bd8b 100644 --- a/src/libsync/filesystem.cpp +++ b/src/libsync/filesystem.cpp @@ -259,6 +259,8 @@ qint64 FileSystem::getSize(const QString &filename) // Code inspired from Qt5's QDir::removeRecursively bool FileSystem::removeRecursively(const QString &path, const std::function &onDeleted, QStringList *errors) { + FileSystem::setFolderPermissions(path, FileSystem::FolderPermissions::ReadWrite); + bool allRemoved = true; QDirIterator di(path, QDir::AllEntries | QDir::Hidden | QDir::System | QDir::NoDotAndDotDot); diff --git a/src/libsync/propagatorjobs.cpp b/src/libsync/propagatorjobs.cpp index b1d85e198..a443d8454 100644 --- a/src/libsync/propagatorjobs.cpp +++ b/src/libsync/propagatorjobs.cpp @@ -63,7 +63,6 @@ bool PropagateLocalRemove::removeRecursively(const QString &path) const auto fileInfo = QFileInfo{absolute}; const auto parentFolderPath = fileInfo.dir().absolutePath(); const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite}; - FileSystem::setFolderPermissions(absolute, FileSystem::FolderPermissions::ReadWrite); bool success = FileSystem::removeRecursively( absolute, [&deleted](const QString &path, bool isDir) {